<template>
      <div class="numbox">
        <van-stepper  v-model= "value" min="1" :max="stock" integer
        button-size="32px" input-width="60px"  @change="getnumber" />
      </div>
</template>
<script>
    export default {
        data() {
            return {
                value: 1,
            }
        },
        methods: {
            //监听输入框数据变化 传值给父组件
            getnumber() {
                this.$emit('numbox', this.value);
            },

        },
        //将库存传入最大值中
        props: ['stock']
    }
</script>
<style>

</style>